home *** CD-ROM | disk | FTP | other *** search
/ The Utilities Experience / The Utilities Experience - Volume 1.iso / software / graphics / h-m / ie / arexx / scale50.rexx < prev    next >
OS/2 REXX Batch file  |  1995-12-21  |  995b  |  38 lines

  1. /******************************/
  2. /* Image Engineer Macro       */
  3. /* by Simon Edwards           */
  4. /* Scale a given image by 50% */
  5. /******************************/
  6.  
  7. Options results
  8. signal on error            /* Setup a place for errors to go */
  9.  
  10. if arg()==0 then exit
  11.  
  12. project_info arg(1) WIDTH
  13. NewWidth=RESULT/2
  14. project_info arg(1) HEIGHT
  15. NewHeight=RESULT/2
  16.  
  17. SCALE arg(1) NewWidth NewHeight BEST
  18.  
  19. exit
  20.  
  21. /*******************************************************************/
  22. /* This is where control goes when an error code is returned by IE */
  23. /* It puts up a message saying what happened and on which line     */
  24. /*******************************************************************/
  25. error:
  26. if RC=5 then do            /* Did the user just cancel us? */
  27.     IE_TO_FRONT
  28.     LAST_ERROR
  29.     'REQUEST "'||RESULT||'"'
  30.     exit
  31. end
  32. else do
  33.     IE_TO_FRONT
  34.     LAST_ERROR
  35.     'REQUEST "Error detected!!!'||D2C(10)||'Image Engineer error message is as follows'||D2C(10)||result||D2C(10)||'Script failed on line '||SIGL||'"' 'Doh!'
  36.     exit
  37. end
  38.